// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-6-10

#ifndef __MAINUIMAN_H_CLIENT_MAIN__
#define __MAINUIMAN_H_CLIENT_MAIN__

#pragma once

#include <common\ui\manager.h>
//del by deng
//#include "commserver.h"`


class CJoyMainWnd;
class CJoyLoginWnd;
class CJoyLobbyPage;
class CJoyRoomPage;
class CJoyMainPageCtrl;
struct CMD_INFO;

//##ModelId=44C4B5E100AB
class CJoyMainManager :
    public CJoyManager
{
protected:
public:
	//##ModelId=44C4B5E100BC
    CJoyMainWnd*    m_mainWnd;
	//##ModelId=44C4B5E100C1
    CJoyLoginWnd*   m_loginWnd;
	//##ModelId=44C4B5E100C6
    CJoyLobbyPage*  m_lobbyPage;
	//##ModelId=44C4B5E100CE
    CJoyRoomPage*   m_roomPage;
	//##ModelId=44C4B5E100D3
    CJoyMainPageCtrl*   m_mainPageCtrl;
	
    UINT	m_mainVer;  // version of joy_main
    UINT	m_fileVer;  // version of all files of client.

  //del by deng
   // CJoyCommServer  m_commServer;


	//##ModelId=44C4B5E100DB
    CJoyGameFile    m_gameDef;
	//##ModelId=44C4B5E100DF
    bool LoadGameDef();
public:
	//##ModelId=44C4B5E100E0
    CJoyMainManager(void);
	//##ModelId=44C4B5E100E2
    virtual ~CJoyMainManager(void);
	//##ModelId=44C4B5E100EB
	void QuitDodal();
	//##ModelId=44C4B5E100EC
    virtual bool Create(HICON defIcon, HCURSOR defCursor);
	//##ModelId=44C4B5E100F0
    virtual void Destroy();
	//##ModelId=44C4B5E100FB
    CJoyMainWnd* CreateMain();
	//##ModelId=44C4B5E100FC
    void DestroyMain();
	//##ModelId=44C4B5E100FD
    CJoyLoginWnd* CreateLogin(CMD_INFO cmdinfo);

	//##ModelId=44C4B5E100FF
    CJoyLoginWnd* GetLoginWnd() const
    {
        return m_loginWnd;
    }
	//##ModelId=44C4B5E1010A
    CJoyMainWnd* GetMainWnd() const
    {
        return m_mainWnd;
    }
	//##ModelId=44C4B5E1010C
	CString m_currentPath;

private:
	//##ModelId=44C4B5E1010D
	CString getCurrentPath()
	{
		char lpBuf[200];
		GetCurrentDirectory(200,lpBuf);
		return _T(lpBuf);
	}


};

inline CJoyMainManager* JoyGetMainManager()
{
    return (CJoyMainManager*)JoyGetManager();
}


#endif  // __MAINUIMAN_H_CLIENT_MAIN__
